/**
 * 更新密码
 */
$(function(){
	var codelength=$('#oldPassword').width();
	$('#oldPassword').validatebox({
	    required: true,
	    validType: 'englishnum',
	    tipPosition:'top',
	    deltaX:codelength/4
	});
	$('#password').validatebox({
	    required: true,
	    validType: [
	    	    	'englishnum',
	    	    	'minLength[4]',
	    	    	'maxLength[50]'
	    	    ],
	    tipPosition:'top',
	    deltaX:codelength/4
	});
	$('#confimpassword').validatebox({
	    required: true,
	    validType: {same:['password']},
	    tipPosition:'top',
	    deltaX:codelength/4
	});
	//提交表单
	$("#submitBut").click(function(){
		$("#form_line").form('submit',{
			url:$Path+'/admin/operator/updatePassword',
			onSubmit:function(){
		        return $(this).form('validate');
		    },
		    success:function(data){
		    	var jdata=$.parseJSON(data); 
		        if(jdata.code==200){
		        	parent.$.messager.alert('成功','修改成功','info',function(){
		        		parent.$('#dlg').window('close');
		        	});
		        }
		        else{
		        	parent.$.messager.alert('失败',jdata.msg,'error');
		        }
		    }
		});
	})
})